package com.itheima.demo02;

//人类, 父类.
public class Person {
    //属性
    private String name;
    private String id;
    private int salary;

    //构造方法
    public Person() {
    }

    public Person(String name, String id, int salary) {
        this.name = name;
        this.id = id;
        this.salary = salary;
    }

    //getXxx()和setXxx()
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    //行为.
    public void eat() {
        System.out.println("人要吃饭！");
    }

    public void sleep() {
        System.out.println("人要睡觉！");
    }

    public void work() {
        System.out.println("人要工作！");
    }
}
